You are here: Symbol Reference > Dew Namespace > Dew.Signal Namespace > Dew.Signal.Units Namespace > Classes > SignalUtils Class > SignalUtils Methods > SavGolayImpulse Method > SignalUtils.SavGolayImpulse Method ([In] TVec, int, int, [In] TVec)
Dew Signal for .NET
ContentsIndexHome
PreviousUpNext
SignalUtils.SavGolayImpulse Method ([In] TVec, int, int, [In] TVec)

The resulting H vector contains FIR type impulse response, which can be passed to the FirInit routine.

Syntax
C#
Visual Basic
public static void SavGolayImpulse([In] TVec H, int FrameSize, int Order, [In] TVec Weights);

Streamed filtering. A vector with a sine signal is broken down in to smaller pieces and they are filtered one by one.

using Dew.Math; using Dew.Math.Editors; using Dew.Math.Units; using Dew.Signal; using Dew.Signal.Units; using Dew.Math.Tee; using Dew.Signal.Tee; private void button1_Click(object sender, EventArgs e) { Vector h = new Vector(0); Vector b = MtxExpr.Ramp(300, TMtxFloatPrecision.mvDouble, 0, 0.1); Vector c = new Vector(b.Length); TFirState state = new TFirState(); int n = 10; int i; SignalUtils.SavGolayImpulse(h,15,7,null); SignalUtils.FirInit(h,ref state,1,0,1,0); try { c.Size(b); n = 10; int bLength = b.Length; //must be outside of the "for" to prevent reevaluation for (i = 0; i < (bLength/n); i++) { b.SetSubRange(i * n, n); //select only a small subvector of the vector c.SetSubRange(i * n, n); SignalUtils.FirFilter(b,c,ref state); } MtxVecTee.DrawIt(new TVec[2] { b, c }, new string[2] { "Filtered data", "Original data" }, "Savitzky Golay", false); } finally { SignalUtils.FirFree(ref state); } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!